﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ModbusTestTool
{
    class TypeAdapter
    {
        private TypeAdapter()
        {
        }

        static public BaseRegister SetupTypemapFields(string inParamName, int inRegister, paramType inType)
        {



            switch (inType)
            {
                case paramType.float_t: return new FloatInvType(inParamName, inRegister);
                case paramType.word_t:  return new Uword(inParamName, inRegister);
                case paramType.long_t:  return new ULongInv(inParamName, inRegister);
                case paramType.float_i_t: return new FloatType(inParamName, inRegister);
                default:                return new Uword(inParamName, inRegister);

            }

            //if (inType == paramType.float_t)
            //{
            //    return new FloatInvType(inParamName,inRegister);
            //}
            //else if (inType == paramType.word_t)
            //{
            //    return new Uword(inParamName, inRegister);
            //}
            
            //else
            //{
            //    return new Uword(inParamName, inRegister);
            //}

            
        }
    }
}
